/**
 * @file dev_imu.c
 * @brief 
 * 
 * @author dalin (dalin@robot.com)
 * @version 1.0
 * @date 2023-06-05
 * 
 * @copyright Copyright (c) 2023  OpenSir Tech.co, Ltd
 * 
 * @par 修改日志:
 * Date           Version     Author      Description
 * 2023-06-05     1.0         yangsl      touch
 */

#include "dev_encoder.h"
#include "tim.h"
#include "mlog.h"

#define DEV_ENCODER_LEFT    DRV_TIM3
#define DEV_ENCODER_RIGHT   DRV_TIM4


void encoder_open(void)
{
   drv_tim_encoder_start(DEV_ENCODER_LEFT, TIM_CH_ALL);
   drv_tim_encoder_start(DEV_ENCODER_RIGHT, TIM_CH_ALL);
}


/**
  * @brief   读取编码器转速值
  */
void dev_read_encoder_test(void)
{
    int speed1, speed2;

    drv_tim_encoder_speed(DEV_ENCODER_LEFT, &speed1);
    drv_tim_encoder_speed(DEV_ENCODER_RIGHT, &speed2);

    log_info("speed1: %d  speed2: %d", speed1, speed2);

}






